#ifndef DEPTHVIDEOWIDGET_H
#define DEPTHVIDEOWIDGET_H

#include <QObject>
#include <QWidget>
#include <QMutex>
#pragma execution_character_set("utf-8")
class DepthVideoWidget : public QWidget
{
    Q_OBJECT
public:
    explicit DepthVideoWidget(QWidget *parent = nullptr);
    ~DepthVideoWidget();

    void setFrame(const QImage& frame);

    void clearFrame();

    void setDepthData(const QVector<quint16>& dapthData,int width,int height);
signals:

protected:
    void paintEvent(QPaintEvent* event) override;
    void mouseMoveEvent(QMouseEvent* event) override;
    void leaveEvent(QEvent* event) override;

private:
    QMutex m_mutex;
    QPixmap m_currentFrame;
    QVector<quint16> m_depthData;
    int m_depthWidth;
    int m_depthHeight;
    QPoint m_lastPos;
};

#endif // DEPTHVIDEOWIDGET_H
